<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>uploader demo 开启MD5验证</title>
	<script src="../avalon.js"></script>
	<link rel="stylesheet" href="../style/avalon.doc.css"/>
	<link rel="stylesheet" href="avalon.fileuploader.ex.css"/>
</head>
<body ms-controller="demo">
	<h1><a name="chunk">MD5验证</a></h1>
	<p>设置enableMd5Validation为true时，会在发送给服务器的请求内，加入分块数据base64编码后的MD5码，在未开启分块上传或者文件小于分块尺寸限定时，附加的MD5码为整个文件的MD5。默认的MD5验证为关闭状态。本例打开了MD5验证，可在F12工具内看见新增的MD5码。</p>
    <div ms-widget="fileuploader,demoUploader1,$uploaderOptions1"></div>


	<script>
		require(["./fileuploader/avalon.fileuploader","domReady!"], function($$){
			var model = $$.define("demo", function(vm){
				var basicOptions = {
		            addButtonText: "添加文件",
		            uploadButtonText: "开始上传",
		            serverConfig: {
		                url: "../../Handler1.ashx",
		                userName: undefined,
		                password: undefined
		            },
					onFileOverSize: function (fileObj) {
						alert(fileObj.name+"超出了文件尺寸限制")
					},
					onSameFileAdded: function () {
						alert("不能添加相同的文件");
					},
					onFilePoolOverSize: function (fileObj, poolSize) {
						alert("文件缓存池达已满，不能继续添加文件。")
					}
				};


				vm.$uploaderOptions1 = $$.mix({
					enableMd5Validation: true
				}, basicOptions);
			});
			$$.scan();
		});
	</script>
</body>
</html>

